package com.hotel.controller;

import com.hotel.component.BaseController;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
import java.util.Set;

/**
 * @Author Str
 * @Date 2021/10/29 20:26
 * @Description :
 */
@WebServlet("/Test/*")
public class TestController extends BaseController {

    //[1] /Test/search?username=andy&age=50&page5
    //[2] /Test/search?username=andy&age=50
    public String search( HttpServletRequest req,
                          HttpServletResponse resp )
            throws IOException, ServletException {
        Map<String,Object> keyWords = getKeyWords( req );
        Set<String> keySet = keyWords.keySet();
        for (String key : keySet) {
            Object val = keyWords.get(key);
            System.out.printf("%s:%s\n", key, val);
        }
        return "data:HelloWorld..";
    }

}
